#include "start.h"
#include "ui_start.h"
#include"mainwindow.h"


start::start(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::start)
{
    ui->setupUi(this);
    this->resize(400,400);
}

start::~start()
{
    delete ui;
}

void start::on_pushButton_clicked()
{
    MainWindow *d=new MainWindow();//让mainwindow的空间不被释放，因为它的作用域起初只在大括号里
    d->show();
    this->close();//点击按钮得把开始界面关掉
}
void start::paintEvent(QPaintEvent *event){
    this->setWindowTitle("五子棋");
    QPainter painter(this);
    painter.drawPixmap(0,0,400,400,
                       QPixmap(":/image/image/gobang.png"));
}
